home *** CD-ROM | disk | FTP | other *** search
- #include "stdio.h"
-
- void main()
- {
- FILE *infile, *outfile, *printer;
- char c, infilename[25], outfilename[25];
-
- printf("Enter input file name ----> ");
- scanf("%s", infilename);
- infile = fopen(infilename, "r");
-
- printf("Enter output file name ---> ");
- scanf("%s", outfilename);
- outfile = fopen(outfilename, "w");
-
- printer = fopen("PRN", "w");
-
- do {
- c = getc(infile);
- if (c != EOF) {
- putchar(c);
- putc(c, outfile);
- putc(c, printer);
- }
- } while (c != EOF);
-
- fclose(printer);
- fclose(infile);
- fclose(outfile);
- }
-
-
-
- /* Result of execution
-
- (This program writes to the printer, a file, and the monitor.)
-
- */
-